<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<div id="suppliersDetails">
	<h2><fmt:message key="site.supplierDetails"/></h2>
	
	<div class="form_holder">
		<div class="left_col">
			<div class="row">
				<div class="label_holder">
					<fmt:message key="site.name"/>:
				</div>
				<div class="data_holder">
					${supplierBean.name}
				</div>
			</div>
			<div class="row">
				<div class="label_holder">
					<fmt:message key="site.email"/>:
				</div>
				<div class="data_holder">
					${supplierBean.email}
				</div>
			</div>
			<div class="row">
				<div class="label_holder">
					<fmt:message key="site.phoneNumber"/>:
				</div>
				<div class="data_holder">
					${supplierBean.phoneNumber}
				</div>
			</div>
		</div>
		<div class="right_col">
			<div class="row">
				<div class="label_holder">
					<fmt:message key="site.address"/>:
				</div>
				<div class="textarea_holder">
					${supplierBean.address}
				</div>
			</div>
		</div>
	</div>
	
	<form:form modelAttribute="supplierBean">
		<div class="items_delivery_holder">
			<div class="left_col">
				<div>
					<label class="title"><fmt:message key="site.suppliedItems"/>:</label>
				</div>
				<div class="items_holder">
					<form:select path="itemIds" multiple="multiple">
						<c:forEach var="item" items="${supplierBean.items}">
							<option value="${item.id}">${item.name}</option>
						</c:forEach>
					</form:select>
				</div>
			</div>
	
			<div class="right_col">
				<div class="amount_holder">
					<fmt:message key="site.amount"/>:
					<form:input path="deliveryAmount"/>
				</div>
				<div class="btn_holder">
					<input type="image" name="_eventId_makeDelivery" value="<fmt:message key="button.makeDelivery"/>" src="<c:url value="/images/buttons/makeDelivery_btn.PNG"/>"/>
				</div>
				<div class="status_holder">
					<fmt:message key="site.status"/>: 
					<c:if test="${not empty deliveryStatus}">
						<c:choose>
							<c:when test="${deliveryStatus}"><span class="green"><fmt:message key="site.successfulDelivery"/></span></c:when>
							<c:otherwise><span class="red"><fmt:message key="site.errorInDelivery"/></span></c:otherwise>
						</c:choose>
					</c:if>
				</div>
			</div>
		</div>
	</form:form>
	
	<form:form>
		<input type="image" name="_eventId_back" value="<fmt:message key="button.back"/>" src="<c:url value="/images/buttons/back_btn.PNG"/>"/>
	</form:form>
</div>